﻿using MvcArchStarter.Core.Persistence;
using MvcArchStarter.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcArchStarter.WebUI.Controllers
{
    public class HomeController : Controller
    {
        private IUnitOfWork _uow;

        public HomeController(IUnitOfWork uow)
        {
            _uow = uow;
        }
        public ActionResult Index()
        {
            var blogs = _uow.RepositoryOf<Blog>().FindAll();

            ViewBag.Message = "View all of your blogs on this screen.";

            return View(blogs.ToList());
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
